package com.fs.ibox.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fs.ibox.dao.CollectionDao;
import com.fs.ibox.dao.IdCollectionDao;
import com.fs.ibox.dao.impl.CollectionDaoimpl;
import com.fs.ibox.dao.impl.IdCollectionDaoimpl;
import com.fs.ibox.pojo.Collection;
import com.fs.ibox.pojo.IdCollection;
import com.fs.ibox.service.MarketService;
import com.fs.ibox.util.BeanFactory;
import com.fs.ibox.util.JDBCUtil;
import com.fs.ibox.vo.MarketCollection;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class MarketServiceImpl implements MarketService {

    private IdCollectionDao idCollectionDao;
    private CollectionDao collectionDao;

    public MarketServiceImpl() {/*
        BeanFactory.createBean(IdCollectionDaoimpl.class);
        BeanFactory.createBean(CollectionDaoimpl.class);
        */
        idCollectionDao = new IdCollectionDaoimpl();
        collectionDao = new CollectionDaoimpl();


    }


    @Override
    public List<MarketCollection> selectMarket(String username) {
        List<MarketCollection> marketCollections = idCollectionDao.queryMarketCollections(username);
        return marketCollections;
    }

    @Override
    public MarketCollection selectMarketById(Integer id) {

        return idCollectionDao.queryMarketById(id);
    }

}
